package com.forum.module.system.dal.dataobject.file;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.forum.framework.mybatis.core.dataobject.BaseDO;

import java.util.Objects;

/**
 * 功能:文件快照 DO
 * 作者:ouyzh
 * 日期:2025/3/2 16:32
 */
@TableName(value = "system_file", autoResultMap = true)
public class FileDO extends BaseDO {
    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 文件名
     */
    private String filename;

    /**
     * 文件大小
     */
    private String filesize;

    /**
     * 文件类型
     */
    private String filetype;

    /**
     * 文件路径（为URL路径，非真实存储地址）
     */
    private String filepath;

    /**
     * 文件状态
     */
    private Integer status;

    /**
     * 文件备注
     */
    private String remark;

    public FileDO() {

    }

    public FileDO(Long id, String filename, String filesize, String filetype, String filepath, Integer status, String remark) {
        this.id = id;
        this.filename = filename;
        this.filesize = filesize;
        this.filetype = filetype;
        this.filepath = filepath;
        this.status = status;
        this.remark = remark;
    }

    public Long getId() {
        return id;
    }

    public FileDO setId(Long id) {
        this.id = id;
        return this;
    }

    public String getFilename() {
        return filename;
    }

    public FileDO setFilename(String filename) {
        this.filename = filename;
        return this;
    }

    public String getFilesize() {
        return filesize;
    }

    public FileDO setFilesize(String filesize) {
        this.filesize = filesize;
        return this;
    }

    public String getFiletype() {
        return filetype;
    }

    public FileDO setFiletype(String filetype) {
        this.filetype = filetype;
        return this;
    }

    public String getFilepath() {
        return filepath;
    }

    public FileDO setFilepath(String filepath) {
        this.filepath = filepath;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public FileDO setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public FileDO setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        FileDO fileDO = (FileDO) object;
        return Objects.equals(id, fileDO.id) && Objects.equals(filename, fileDO.filename) && Objects.equals(filesize, fileDO.filesize) && Objects.equals(filetype, fileDO.filetype) && Objects.equals(filepath, fileDO.filepath) && Objects.equals(status, fileDO.status) && Objects.equals(remark, fileDO.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, filename, filesize, filetype, filepath, status, remark);
    }
}
